#coding=utf-8

import pymysql
from comm import config

def test_sql():
    sql = '''
       SELECT * FROM user_role limit 10
       '''
    conn = pymysql.connect(**config.dbinfo)
    cursor = conn.cursor()
    cursor.execute(sql)
    for r in cursor.fetchall():
        print '%s,%s,%s'%(r[0],r[1],r[2])
    cursor.close()
    conn.close()

if __name__ == '__main__':
    test_sql()